package lab02.test32;

import java.util.HashMap;
import java.util.Map;

public class Test32 {
    public static void main(String[] args) {
        Map<String,String> map= new HashMap<String,String>();
        map.put("id","2");
        map.put("name","张三");
        map.put("gender","男");
        map.put("age","16");
        map.put("love","读书");

        for(Map.Entry<String,String> entry : map.entrySet()) {
            System.out.println(entry.getKey() + " : " + entry.getValue());
        }

        System.out.println("集合大小:" + map.size());
        System.out.println("删除元素的内容:" + map.get("age"));
        map.remove("age");
        System.out.println("删除元素后集合的大小:" + map.size());
    }
}
